<template>
  <div>
    <h2 class="count">我是Count组件</h2>
    <button @click="changeAppValue(3)">累加app中的count</button>
<!--    取消事件绑定-->
    <button @click="off">取消绑定</button>
  </div>
</template>

<script>
export default {
  name: "Count",
  data(){
    return{
    }
  },
  methods:{
    changeAppValue(count){
      this.$emit('changeValue',count)
    },
    off(){
      //写法一
      // this.$off('changeValue')
    //  写法二
      this.$off(['changeValue'])
    }
  }
}
</script>

<style scoped>

</style>